Developer --> Technical Publications
PATHMac OS 8 Developer Documentation > Files > Navigation Services >

Programming With Navigation Services 1.1


Drawing Custom Previews

By default, Navigation Services draws a preview in the Open dialog box when a file selected in the browser list contains a valid 'pnot' component. To override how previews are drawn and handled, you can create a preview-drawing function, as described in MyPreviewProc . You register your preview-drawing function by passing a Universal Procedure Pointer (UPP) in the previewProc parameter of a Navigation Services function such as NavGetFile . You obtain this UPP by calling the macro NewNavPreviewProc and passing a pointer to your preview-drawing function. When the user selects a file, Navigation Services calls your preview-drawing function. Before you attempt to create a custom preview, your application should determine whether previews are enabled by specifying the kNavCtlIsPreviewShowing constant in the NavCustomControlMessages parameter of the function NavCustomControl .

Your preview-drawing function obtains information from a structure of type NavCBRec specified in the callBackParms parameter of your event-handling function. The NavCBRec structure contains the following information:

Once you have determined that previews are enabled, your preview-drawing function should draw the custom preview in the specified area and return a function result of true . If you don't want to draw a preview for a given file, be sure to return a function result of false .


© 1998 Apple Computer, Inc. – (Last Updated 23 Nov 98)

Previous | Back Up One Level | Next |